package config;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 石小俊
 * @date 2023年07月13日 9:18
 */
public class Action {
    private String path;
    private String type;
    private String parameter;
    private Map<String,Forward> forwards = new HashMap<>();

    @Override
    public String toString() {
        return "Action{" +
                "path='" + path + '\'' +
                ", type='" + type + '\'' +
                ", parameter='" + parameter + '\'' +
                ", forwards=" + forwards +
                '}';
    }

    public void addForward(Forward forward){
        forwards.put(forward.getName(),forward);
    }

    public Forward findForward(String name){
        return forwards.get(name);
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getParameter() {
        return parameter;
    }

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    public Map<String, Forward> getForwards() {
        return forwards;
    }

    public void setForwards(Map<String, Forward> forwards) {
        this.forwards = forwards;
    }
}
